<template>
  <div>
    <el-card>
      <div slot="header">
        <span>添加账号</span>
      </div>
      <el-form
        :rules="rules"
        status-icon
        size="small"
        label-width="100px"
        class="form"
        :model="formData"
        ref="formRef"
      >
        <el-form-item label="账号" prop="account">
          <el-input type="account" v-model="formData.account"></el-input>
        </el-form-item>
        <el-form-item label="新密码" prop="password">
          <el-input type="password" v-model="formData.password"></el-input>
        </el-form-item>
        <el-form-item label="确认新密码" prop="againAccount">
          <el-input type="password" v-model="formData.newPwd"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary">提交</el-button>
          <el-button>重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
//解构ajax函数
import {checkOldPwdReq, editPwdReq} from '@/api/user'
//验证账号是否存在
const checkAccount = async (rule, value, callback) => {
  
}
//验证密码
const checkPassword = async (rule, value, callback) => {}
export default {
  data() {
    return {
      formData: {
        account: '',
        password: '',
        newPwd: '',
      },
      //验证规则
      rules: {
        account: [{validator: checkAccount, trigger: 'blur'}],
        password: [{validator: checkPassword, trigger: 'blur'}],
        newPwd: [{validator: checkPassword, trigger: 'blur'}],
      },
    }
  },
}
</script>

<style lang="scss" scoped>
.form {
  width: 280px;
}
</style>
